Usage Note 39035: The HHMMSS informat reads time values without delimiters
The HHMMSSw. informat reads time values with and without delimiters. It differs from the TIMEw. informat since the TIMEw. informat requires delimiters between hours, minutes, and seconds.
Beginning with SAS® 9.3, the HHMMSSw. informat reads values with/without colons/decimals as follows:
#colons decimal? examples computation
0 no 1,123,12345 01:00:00, 12:30:00, 12:34:50
0 yes 1.23,123.45 00:00:01.23, 00:02:03.45
1 no 12:34 12:34:00
1 yes 12:34.56 00:12:34.56
2 no 12:34:56 12:34:56
2 yes 12:34:56.7 12:34:56.7
If there are two colons, the input is processed like the TIMEw. informat.
If there is one colon and no decimal, we logically append :00 to the value.
If there is one colon and a decimal, we logically prepend :00 to the value.
If there is no colon and no decimal, we logically append zeros to six digits, then read two digits for hour, two digits for minutes, and two digits for seconds.
If there is no colon but there is a decimal, the input is treated as the number of seconds + fractions of seconds.
To obtain the new behavior prior to SAS 9.3, use the B8601TM informat.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9 TS M0 | 9.3 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | 9.3 TS1M0 |
Microsoft Windows XP Professional | 9 TS M0 | 9.3 TS1M0 |
64-bit Enabled AIX | 9 TS M0 | 9.3 TS1M0 |
64-bit Enabled HP-UX | 9 TS M0 | 9.3 TS1M0 |
64-bit Enabled Solaris | 9 TS M0 | 9.3 TS1M0 |
HP-UX IPF | 9 TS M0 | 9.3 TS1M0 |
Linux | 9 TS M0 | 9.3 TS1M0 |
OpenVMS Alpha | 9 TS M0 | 9.3 TS1M0 |
Tru64 UNIX | 9 TS M0 | 9.3 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The HHMMSSw. informat reads time values without delimiters.
data _null_;
x=input('12:30:45',hhmmss.);
y=input('123045',hhmmss.);
put x=time8. y=time8.;
run;
1430 data _null_;
1431 x=input('12:30:45',hhmmss.);
1432 y=input('123045',hhmmss.);
1433 put x=time8. y=time8.;
1434 run;
x=12:30:45 y=12:30:45
Although the HHMMSSw. informat has been available for quite some time, it was mistakenly omitted from documentation.
Type: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> Informats ==> Date and Time
|
Date Modified: | 2012-10-17 10:42:04 |
Date Created: | 2010-03-15 11:01:25 |